package com.hoko.blur.api;

import com.hoko.blur.task.AsyncBlurTask;
import ohos.agp.components.Component;
import ohos.media.image.PixelMap;

import java.util.concurrent.Future;

/**
 * IBlurProcessor
 *
 * @since 2021/08/03
 */
public interface IBlurProcessor {
    /**
     * apply the blur effect to a bitmap
     *
     * @param bitmap the original bitmap
     * @return the blurred bitmap
     */
    PixelMap blur(PixelMap bitmap);

    /**
     * apply the blur effect to a view
     *
     * @param view the original view
     * @return the bitmap of the blurred view
     */
    PixelMap blur(Component view);

    /**
     * asyncBlur
     *
     * @param bitmap q
     * @param callback q
     * @return q
     */
    Future asyncBlur(PixelMap bitmap, AsyncBlurTask.Callback callback);

    /**
     * asyncBlur
     *
     * @param view q
     * @param callback q
     * @return q
     */
    Future asyncBlur(Component view, AsyncBlurTask.Callback callback);

}
